package com.taojie.graduation.controller;

import com.taojie.graduation.domain.Admin;
import com.taojie.graduation.service.api.AdminService;
import com.taojie.graduation.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@Api(tags = {"管理员"})
@RequestMapping("admin")
public class AdminController {

    @Resource
    private AdminService adminService;

    @ApiOperation("登录")
    @PostMapping("login")
    public Result login(@RequestBody Admin admin){
        return adminService.findAdmin(admin);
    }


}
